/*
 * @Author: Jimmy
 * @LastModifiedBy: Jimmy
 * @Date: 2024-07-06 20:57:49
 * @LastEditTime: 2024-07-07 11:08:18
 * @FilePath: /nest_study/server/src/modules/system/dict/entities/dict.type.entity.ts
 */
import { ApiProperty } from "@nestjs/swagger";
import { BaseEntity } from "src/common/entites/base";
import { Column, Entity, PrimaryGeneratedColumn } from "typeorm";

@Entity('sys_dict_type', { comment: '字典类型表' })
export class SystemDictTypeEntity extends BaseEntity {
    @ApiProperty({ type: Number, description: '字典主键' })
    @PrimaryGeneratedColumn({
        type: 'int',
        name: 'dict_id',
        comment: '字典主键'
    })
    public id: number;

    @Column({
        type: 'varchar',
        name: 'dict_name',
        comment: '字典名称',
        length: 100,
        unique: true
    })
    public name: string

    @Column({
        type: 'varchar',
        name: 'dict_code',
        comment: '字典编码',
        length: 100,
        unique: true
    })
    public code: string

    @Column({ type: 'int', name: 'dict_sort', default: 0, comment: '字典排序' })
    public sort: number;
}